%option noyywrap

%{
    
    #include<stdio.h>

    #include<string>
   
    #include<iostream>
    
    #include<map>
   
    #include<set>
    
    using namespace std;
  
    set<string> table;
    
    long int num=201492103;
    
    char*name="wyr";
    
    long int number;
   
    long int sum1=0;
    
    long int sum2=0;

%}


Digit       [0-9]

Number      ^{Digit}{9}

Sum         {Digit}+(\.{Digit}+)?

Name         NAME$

Space       [\n\t]


%%

{Number} {printf("%d",num);}
 
{Name} {printf("%s",name);}
 
{Sum} {sum1++;
table.insert(yytext);

 number=((long int)atof(yytext)*2+num+0.5);

 cout<<number;}

. {cout<<yytext;}
%%

int main()

{
   yylex(); sum2=table.size();printf("出现次数%d去重后次数%d",sum1,sum2);
    return 0;
}


